package com.neusoft.shopping.manager.controller;

import com.neusoft.shopping.manager.entity.OrderEntity;
import com.neusoft.shopping.manager.service.DetailsServise;
import com.neusoft.shopping.manager.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;
import java.util.List;

@Controller
public class OrderController {
    @Autowired
    OrderService service;
    @RequestMapping("/order_show")
    public ModelAndView show_order(){
        DetailsServise detailsServise=new DetailsServise();
        ModelAndView modelAndView=new ModelAndView();
        List<OrderEntity> orders=service.quretAll();
        modelAndView.addObject("orders",orders);
        modelAndView.setViewName("order_show");
        return modelAndView;
    }
}
